#if !defined(__CHARBOX_H__)
#define __CHARBOX_H__

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include "CharView.h"

/////////////////////////////////////////////////////////////////////////
// CSCBButton (button info) helper class

//class CSCBButton
//{
//public:
//    CSCBButton();
//
//    void Move(CPoint ptTo) {ptOrg = ptTo; };
//    CRect GetRect() { return CRect(ptOrg, CSize(13, 13)); };
//    void Paint(CDC* pDC);
//
//    BOOL    bPushed;
//    BOOL    bRaised;
//
//protected:
//    CPoint  ptOrg;
//};

/////////////////////////////////////////////////////////////////////////
// CSizingControlBar control bar

#ifndef baseCCharBox
#define baseCCharBox CSizingControlBar
#endif

class CCharBox : public baseCCharBox
{
    DECLARE_DYNAMIC(CCharBox);

// Construction
public:
    CCharBox();

// Attributes
public:
	CCharView m_view;
    virtual BOOL HasGripper() const;
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	CStringArray m_arrCharSetName;
	
// Operations
public:

// Overridables
    virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler);
	afx_msg BOOL OnToolTipText(UINT, NMHDR* pNMHDR, LRESULT* pResult);
	
// Overrides
public:
    // ClassWizard generated virtual function overrides
    //{{AFX_VIRTUAL(CCharBox)
    //}}AFX_VIRTUAL

// Implementation
public:
	int m_nOffsetY;
//	CSize m_sizeAttached;
	void ReloadCharSet();
	int m_nCurCharSet;
	void SetCurCharSet(int nIndex);
	BOOL bAttachCharBox;
    virtual ~CCharBox();
    
protected:
    // implementation helpers
    virtual void NcPaintGripper(CDC* pDC, CRect rcClient);
    virtual void NcCalcClient(LPRECT pRc, UINT nDockBarID);

protected:
    int     m_cyGripper;
//    CSCBButton m_biHide;
    BOOL    m_bActive; // a child has focus
    CString m_sFontFace;

// Generated message map functions
protected:
	BOOL m_bOnCaption;
    //{{AFX_MSG(CCharBox)
    afx_msg UINT OnNcHitTest(CPoint point);
    afx_msg void OnNcLButtonUp(UINT nHitTest, CPoint point);
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnPaint();
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
	afx_msg void OnDestroy();
	afx_msg void OnCancelMode();
	//}}AFX_MSG

	CToolTipCtrl m_tt;
    void RelayEvent(UINT message, WPARAM wParam, LPARAM lParam);
	virtual int OnToolHitTest(CPoint point, TOOLINFO* pTI) const;
    DECLARE_MESSAGE_MAP()
};

#endif // !defined(__CHARBOX_H__)

